package cn.itcast.bos.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.itcast.bos.dao.StandardDao;
import cn.itcast.bos.domain.base.Standard;
import cn.itcast.bos.service.StandardService;
@Service
@Transactional
public class StandardServiceImpl implements StandardService {

	@Autowired
	private StandardDao standardDao;

	@Override
	public void save(Standard standard) {
		standardDao.save(standard);
		
		
	}
	
	
	public Page<Standard> findPage(Pageable pageable){
		return standardDao.findAll(pageable);
	}


	@Override
	public List<Standard> findByName(String name) {
		
		return standardDao.findByName(name);
	}


	@Override
	public void delete(String[] idsArr) {
		for (String id : idsArr) {
			standardDao.delete(Integer.parseInt(id));
		}
		
	}


	//courier的收派标准回显
	@Override
	public List<Standard> findAll() {
		 return standardDao.findAll();
	}
	
	
}
